import React from "react";


class Life extends React.Component{
    constructor(props){
        super(props);
        this.state = {
            date:new Date(),
            count:0
        };
    }

    // state = {
    //     count:0
    // }

    handleAdd = ()=>{
        this.setState({
            count:this.state.count + 1
        });
    }

    handClick(){
        this.setState({
            count:this.state.count + 1
        });
    }

    componentDidMount(){}

    componentWillUnmount(){}

    render(){
        return <div>
            <h1>introduced of life</h1>
            <button onClick={this.handleAdd}>click me</button>
            <button onClick={this.handClick.bind(this)}>click me</button>
            <p>{this.state.count}</p>
        </div>
    }

}

export default Life